<?php
/**
 * File containing the BRail_LdapZendAuthTiein_Identity_Adapter_Teamware class.
 * @package BRail_LdapZendAuthTiein
 */

/**
 * @package BRail_LdapZendAuthTiein
 */
class BRail_LdapZendAuthTiein_Identity_Adapter_Teamware implements BRail_LdapZendAuthTiein_Identity_Adapter_Interface
{
    /**
     * @param string $username
     * @return BRail_Teamware_Entry|false
     */
    public function getIdentity($username)
    {
        $qt = new BRail_Teamware_UserQueryTool(BRail_Teamware_Adapter_Factory::getAdapter());
        $results = $qt->searchByLogin($username);
        return isset($results[0]) ? $results[0] : false;
    }
}